package cn.yunhe.service.impl;

import cn.yunhe.dao.MemberDao;
import cn.yunhe.model.Member;
import cn.yunhe.service.MemberBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

/*spring注解*/
@Service(value = "memberBiz")
public class MemberBizImpl implements MemberBiz {

    /*spring注解*/
    @Autowired
    @Qualifier("memberDao")
    MemberDao memberDao;

    @Override
    public boolean insertMember(Member member) {
        return memberDao.insertMember(member);
    }

    @Override
    public boolean updateMember(Member member) {
        return memberDao.updateMember(member);
    }

    @Override
    public boolean deleteMember(Integer hid) {
        return memberDao.deleteMember(hid);
    }

    @Override
    public Member getById(Integer hid){
        return memberDao.getById(hid);
    }

    @Override
    public List<Member> searchMember(String hql) {
        return memberDao.searchMember(hql);
    }

    @Override
    public List<Member> searchMember(Member member) {
        return memberDao.searchMember(member);
    }

    public MemberDao getMemberDao() {
        return memberDao;
    }

    public void setMemberDao(MemberDao memberDao) {
        this.memberDao = memberDao;
    }
}
